home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / tpnet5.arc / PASNETA.ASM < prev    next >
Assembly Source File  |  1991-04-28  |  31KB  |  1,903 lines

  1. Page 80,132
  2. ;*******************************************************
  3. ;*                               *
  4. ;* VERSION: 1.0                        *
  5. ;*                               *
  6. ;* VERSION: 1.1 modified for TP 5.0 & TASM 1.0           *
  7. ;*          03/04/90 Donald M. DeLapp 307-674-6841     *
  8. ;*                               *
  9. ;*                               *
  10. ;* MODULE NAME: PASNET.ASM    Language Interface     *
  11. ;*                               *
  12. ;* DESCRIPTION:  NetWare interface drivers           *                         *
  13. ;*                               *
  14. ;*        Borland Turbo Pascal interface           *
  15. ;*                               *
  16. ;* INPUTS:  Refer to individual procedures.           *
  17. ;*                               *
  18. ;*                               *
  19. ;* RETURNS (OUTPUTS)  Refer to individual procedures.  *
  20. ;*                               *
  21. ;*                               *
  22. ;*******************************************************
  23.  
  24. title    Turbo Pascal - NetWare Interface Module
  25.  
  26. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++
  27. ;+                               +
  28. ;+ For the following Turbo Pascal interface see        +
  29. ;+ the Borland Turbo Tutor manual and the           +
  30. ;+ Reference Manual                       +
  31. ;+                               +
  32. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++
  33.  
  34. ;cseg    segment byte public 'cseg'
  35. cseg    segment byte public
  36.     assume    cs:cseg
  37.  
  38. public    xtndopn, setattr, eojstat, PRLH_Log, PRLH_Rel, PRLH_Clr, PRLF_Log
  39. public    PRLF_Rel, PRLF_Clr, PRLS_Lck, PRLS_Rel, PRLS_Clr, OpenSem, ExamSem
  40. public    WaitSem, SigSem, ClosSem, setlck, Bakouts, btrans, etrans, exclog
  41. public    exclcks, exculkf, exculks, excclrf, excclrs, reclog, reclck, reculk
  42. public    reculks, recclr, recclrs, eoj, sysout, volstat
  43. public    locdrv, wsid, errmode, bcsmode, ctlspl, splreq, pipreq, dpath, syslog
  44. public    fattr, updfcb, cpyfile, nettod, clsmode, drvmap, retshl, asclog
  45. public    asculkf, ascclrf, Get_PSN, Get_STA, SetServ, ModServ
  46.  
  47.  
  48.  
  49. ;     vector table - starts at 0000, with each ensuing call
  50. ;    offset by 3 (the jmp instruction and an offset address)
  51. ;    jmp    near ptr xtndopn
  52. ;    jmp    near ptr setattr
  53. ;    jmp    near ptr eojstat
  54. ;    jmp    near ptr PRLH_Log
  55. ;    jmp    near ptr PRLH_Rel
  56. ;    jmp    near ptr PRLH_Clr
  57. ;    jmp    near ptr PRLF_Log
  58. ;    jmp    near ptr PRLF_Rel
  59. ;    jmp    near ptr PRLF_Clr
  60. ;    jmp    near ptr PRLS_Lck
  61. ;    jmp    near ptr PRLS_Rel
  62. ;    jmp    near ptr PRLS_Clr
  63. ;    jmp    near ptr OpenSem
  64. ;    jmp    near ptr ExamSem
  65. ;    jmp    near ptr WaitSem
  66. ;    jmp    near ptr SigSem
  67. ;    jmp    near ptr ClosSem
  68. ;    jmp    near ptr setlck
  69. ;    jmp    near ptr Bakouts
  70. ;    jmp    near ptr btrans
  71. ;    jmp    near ptr etrans
  72. ;    jmp    near ptr exclog
  73. ;    jmp    near ptr exclcks
  74. ;    jmp    near ptr exculkf
  75. ;    jmp    near ptr exculks
  76. ;    jmp    near ptr excclrf
  77. ;    jmp    near ptr excclrs
  78. ;    jmp    near ptr reclog
  79. ;    jmp    near ptr reclck
  80. ;    jmp    near ptr reculk
  81. ;    jmp    near ptr reculks
  82. ;    jmp    near ptr recclr
  83. ;    jmp    near ptr recclrs
  84. ;    jmp    near ptr eoj
  85. ;    jmp    near ptr sysout
  86. ;    jmp    near ptr volstat
  87. ;    jmp    near ptr locdrv
  88. ;    jmp    near ptr wsid
  89. ;    jmp    near ptr errmode
  90. ;    jmp    near ptr bcsmode
  91. ;    jmp    near ptr ctlspl
  92. ;    jmp    near ptr splreq
  93. ;    jmp    near ptr pipreq
  94. ;    jmp    near ptr dpath
  95. ;    jmp    near ptr syslog
  96. ;    jmp    near ptr fattr
  97. ;    jmp    near ptr updfcb
  98. ;    jmp    near ptr cpyfile
  99. ;    jmp    near ptr nettod
  100. ;    jmp    near ptr clsmode
  101. ;    jmp    near ptr drvmap
  102. ;    jmp    near ptr retshl
  103. ;    jmp    near ptr asclog
  104. ;    jmp    near ptr asculkf
  105. ;    jmp    near ptr ascclrf
  106. ;    jmp    near ptr Get_PSN
  107. ;    jmp    near ptr Get_STA
  108. ;    jmp    near ptr SetServ
  109. ;    jmp    near ptr ModServ
  110.  
  111.  
  112.  
  113. ;--------------------------------
  114. ; Extended Open a File func(61) (3DH)
  115. ;
  116. ; var
  117. ;    Mode, Handle, RetCode : Integer;
  118. ;    Filename          : String[n];
  119. ;
  120. ; RetCode := xtndopn(Mode, Handle, Filename);
  121. ;
  122.  
  123. xtndopn proc    far
  124.     push    bp
  125.     mov    bp,sp
  126.     push    ds
  127. ;    lds    si,[bp+12]      ; put the mode in ax
  128.     lds    si,[bp+14]      ; put the mode in ax
  129.     mov    ax,[si]
  130.     mov    ah,03Dh         ; put the function in ah
  131. ;    lds    dx,[bp+4]       ;ptr to ASCIIZ string
  132.     lds    dx,[bp+6]       ;ptr to ASCIIZ string
  133.     inc    dx            ;add 1 to get to the beginning of the string
  134.     int    21h
  135.     jnc    noerr
  136.     jmp    quit
  137. noerr:
  138. ;    lds    di,[bp+8]       ;put the handle into the variable
  139.     lds    di,[bp+10]       ;put the handle into the variable
  140.     mov    [di],ax          ;if there is no error and
  141.     xor    ax,ax             ;return a 0
  142. quit:
  143.     pop    ds
  144.     pop    bp
  145.     ret    14
  146. xtndopn endp
  147.  
  148.  
  149.  
  150.  
  151. ;--------------------------------
  152. ; Get or Set File Attributes(handle) func(67) (43H)
  153. ;
  154. ; var
  155. ;    Func, Attribute, ErrCode : Integer;
  156. ;    Filename         : String[n];
  157. ;
  158. ;ErrCode := setattr(Func, Attribute, Filename);
  159. ;
  160.  
  161. setattr proc    far
  162.     push    bp
  163.     mov    bp,sp
  164.     push    ds
  165. ;    lds    si,[bp+12]      ; put the subfunction in ax
  166.     lds    si,[bp+14]      ; put the subfunction in ax
  167.     mov    ax,[si]
  168.     mov    ah,043h         ; put the function in ah
  169. ;    lds    dx,[bp+4]       ;ptr to var desc block for ASCIIZ string
  170.     lds    dx,[bp+6]       ;ptr to var desc block for ASCIIZ string
  171.     inc    dx            ;add 1 to get the address of the string
  172. ;    lds    si,[bp+8]       ;put the attribute to set in cx
  173.     lds    si,[bp+10]       ;put the attribute to set in cx
  174.     mov    cx,[si]
  175.     int    21h
  176.     jnc    okay
  177.     mov    ah,00h
  178.     jmp    getout
  179. okay:
  180. ;    lds    di,[bp+8]       ;put the returned attributes in the
  181.     lds    di,[bp+10]       ;put the returned attributes in the
  182.     mov    [di],cx         ;variable if there is no error
  183.     xor    ax,ax            ;and return a 0
  184. getout:
  185.     pop    ds
  186.     pop    bp
  187.     ret    14
  188. setattr endp
  189.  
  190.  
  191.  
  192.  
  193. ;--------------------------------
  194. ; End of Job Flag Status func(187) (BBH)
  195. ;
  196. ; var
  197. ;    Flag : Integer;
  198. ;
  199. ;ErrCode := eojstat(Flag);
  200. ;
  201.  
  202. eojstat proc    far
  203.     push    bp
  204.     mov    bp,sp
  205.     push    ds
  206. ;    lds    si,[bp+4]   ; put the flag in ax
  207.     lds    si,[bp+6]   ; put the flag in ax
  208.     mov    ax,[si]
  209.     mov    ah,0BBh     ; put the function in ah
  210.     int    21h
  211.     mov    ah,0
  212. ;    lds    di,[bp+4]
  213.     lds    di,[bp+6]
  214.     mov    [di],ax
  215.     pop    ds
  216.     pop    bp
  217.     ret    6
  218. eojstat endp
  219.  
  220.  
  221.  
  222.  
  223. ;------------------------------------------------------------
  224. ;
  225. ; Physical Record Lock: Log Record   BCH
  226. ;
  227. ; var
  228. ;    ErrCode,FileHandle,HiByteOffset,LoByteOffset : Integer
  229. ;    HiLockLen,LoLockLen,Flags,TimeOut         : Integer
  230. ;
  231. ;ErrCode := PRLH_Log(FileHandle,HiByteOffset,LoByteOffset,HiLockLen,
  232. ;             LoLockLen,Flags,TimeOut);
  233. ;
  234.  
  235. PRLH_Log proc    far
  236.     push    bp
  237.     mov    bp,sp
  238.     push    ds
  239. ;    lds    si,[bp+28]        ;FileHandle
  240.     lds    si,[bp+30]        ;FileHandle
  241.     mov    bx,[si]
  242. ;    lds    si,[bp+24]        ;ByteOffset
  243.     lds    si,[bp+26]        ;ByteOffset
  244.     mov    cx,[si]
  245. ;    lds    si,[bp+20]
  246.     lds    si,[bp+22]
  247.     mov    dx,[si]
  248. ;    lds    si,[bp+8]        ;AL = Log Flags
  249.     lds    si,[bp+10]        ;AL = Log Flags
  250.     mov    ax,[si]
  251. ;    lds    si,[bp+16]        ;LockLen
  252.     lds    si,[bp+18]        ;LockLen
  253.     mov    si,[si]
  254. ;    lds    di,[bp+12]
  255.     lds    di,[bp+14]
  256.     mov    di,[di]
  257. ;    lds    bp,[bp+4]        ;time out
  258.     lds    bp,[bp+6]        ;time out
  259.     mov    bp,[bp]
  260.     mov    ah,0BCH
  261.     int    21H
  262.     mov    ah,0            ;0 the high byte of the return
  263.     pop    ds
  264.     pop    bp
  265.     ret    30
  266.  
  267. PRLH_Log endp
  268.  
  269.  
  270.  
  271.  
  272.  
  273. ;-----------------------------------------
  274. ;
  275. ; Physical Record Lock: Release Rec  BDH
  276. ;
  277. ; var
  278. ;    FileHandle,HiByteOffset,LoByteOffset,ErrCode,
  279. ;       HiWordLen,LoWordLen : integer;
  280. ;
  281. ; ErrCode := PRLH_Rel(FileHandle,HiByteOffset,LoByteOffset,HiWordLen,
  282. ;                           LoWordLen:integer);
  283.  
  284.  
  285. PRLH_Rel proc    far
  286.     push    bp
  287.     mov    bp,sp
  288.     push    ds
  289. ;    lds    si,[bp+20]        ;FileHandle
  290.     lds    si,[bp+22]        ;FileHandle
  291.     mov    bx,[si]
  292. ;    lds    si,[bp+16]               ;HiByteOffset
  293.     lds    si,[bp+18]               ;HiByteOffset
  294.     mov    cx,[si]
  295. ;    lds    si,[bp+12]            ;LoByte
  296.     lds    si,[bp+14]            ;LoByte
  297.     mov    dx,[si]
  298. ;     lds     si,[bp+8]             ;HiWordLen
  299.      lds     si,[bp+10]             ;HiWordLen
  300.      mov     si,[si]
  301. ;     lds     di,[bp+4]             ;LoWordLen
  302.      lds     di,[bp+6]             ;LoWordLen
  303.      mov     di,[di]
  304.     mov    ah,0BDH
  305.     int    21H
  306.     mov    ah,0
  307.     pop    ds
  308.     pop    bp
  309.     ret    22
  310. PRLH_Rel endp
  311.  
  312.  
  313.  
  314.  
  315.  
  316. ;------------------------------------------------
  317. ;
  318. ; Physical Record Lock: Release Clr  BEH
  319. ;
  320. ; var
  321. ;    FileHandle,HiByteOffset,LoByteOffset,ErrCode,
  322. ;    HiWordLen,LoWordLen : integer;
  323. ;  ErrCode := PRLH_Rel(FileHandle,HiByteOffset,LoByteOffset,HiWordLen,
  324. ;                           LoWordLen:integer);
  325. ;
  326.  
  327.  
  328. PRLH_Clr proc    far
  329.     push    bp
  330.     mov    bp,sp
  331.     push    ds
  332. ;    lds    si,[bp+20]        ;FileHandle
  333.     lds    si,[bp+22]        ;FileHandle
  334.     mov    bx,[si]
  335. ;    lds    si,[bp+16]               ;ByteOffset
  336.     lds    si,[bp+18]               ;ByteOffset
  337.     mov    cx,[si]
  338. ;    lds    si,[bp+12]
  339.     lds    si,[bp+14]
  340.     mov    dx,[si]
  341. ;     lds     si,[bp+8]             ;HiWordLen
  342.      lds     si,[bp+10]             ;HiWordLen
  343.      mov     si,[si]
  344. ;     lds     di,[bp+4]             ;LoWordLen
  345.      lds     di,[bp+6]             ;LoWordLen
  346.      mov     di,[di]
  347.     mov    ah,0BEH
  348.     int    21H
  349.     mov    ah,0
  350.     pop    ds
  351.     pop    bp
  352.     ret    22
  353. PRLH_Clr endp
  354.  
  355.  
  356.  
  357.  
  358.  
  359. ;--------------------------------------------------
  360. ;
  361. ; Physical Record Lock: Log Rec FCB BFH
  362. ;
  363. ; var
  364. ;    ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
  365. ;    HiLockLen,LoLockLen,Flags,TimeOut     : Integer;
  366. ;
  367. ; ErrCode := PRLF_Log(fcb,HiByteOffset,LoByteOffset,HiLockLen,LoLockLen,Flags,TimeOut);
  368. ;
  369.  
  370.  
  371. PRLF_Log proc    far
  372.     push    bp
  373.     mov    bp,sp
  374.     push    ds
  375. ;    lds    si,[bp+28]              ;FCB
  376.     lds    si,[bp+30]              ;FCB
  377.     mov    dx,[si]
  378. ;    lds    si,[bp+24]              ;ByteOffset
  379.     lds    si,[bp+26]              ;ByteOffset
  380.     mov    bx,[si]
  381. ;    lds    si,[bp+20]
  382.     lds    si,[bp+22]
  383.     mov    cx,[si]
  384. ;    lds    si,[bp+8]             ;AL = Log Flags
  385.     lds    si,[bp+10]             ;AL = Log Flags
  386.     mov    ax,[si]
  387. ;    lds    si,[bp+12]              ;low lock length
  388.     lds    si,[bp+14]              ;low lock length
  389.     mov    di,[si]
  390. ;    lds    si,[bp+16]              ;hi lock length
  391.     lds    si,[bp+18]              ;hi lock length
  392.     mov    si,[si]
  393. ;    mov    bp,[bp+4]             ;timeout value
  394.     mov    bp,[bp+6]             ;timeout value
  395.     mov    bp,[bp]
  396.     mov    ah,0BFH
  397.     int    21H
  398.     mov    ah,0
  399.     pop    ds
  400.     pop    bp
  401.     ret    28
  402. PRLF_Log endp
  403.  
  404.  
  405.  
  406.  
  407.  
  408. ;--------------------------------------------------
  409. ;
  410. ; Physical Record Lock: Rel Rec FCB C0H
  411. ;
  412. ; var
  413. ;    ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
  414. ;
  415. ; ErrCode := PRLF_Rel(fcb,HiByteOffset,LoByteOffset);
  416. ;
  417.  
  418.  
  419. PRLF_Rel proc    far
  420.     push    bp
  421.     mov    bp,sp
  422.     push    ds
  423. ;    lds    dx,[bp+12]              ;FCB
  424.     lds    dx,[bp+14]              ;FCB
  425. ;    lds    si,[bp+8]             ;ByteOffset
  426.     lds    si,[bp+10]             ;ByteOffset
  427.     mov    bx,[si]
  428. ;    lds    si,[bp+4]
  429.     lds    si,[bp+6]
  430.     mov    cx,[si]
  431.     mov    ah,0C0H
  432.     int    21H
  433.     mov    ah,0
  434.     pop    ds
  435.     pop    bp
  436.     ret    12
  437. PRLF_Rel endp
  438.  
  439.  
  440.  
  441.  
  442.  
  443. ;-----------------------------------------------
  444. ;
  445. ; Physical Record Lock: Clr Rec FCB C1H
  446. ;
  447. ; var
  448. ;    ErrCode,fcb,HiByteOffset,LoByteOffset : Integer;
  449. ;
  450. ; ErrCode := PRLF_clr(fcb,HiByteOffset,LoByteOffset);
  451. ;
  452.  
  453.  
  454. PRLF_Clr proc    far
  455.     push    bp
  456.     mov    bp,sp
  457.     push    ds
  458. ;    lds    dx,[bp+12]              ;FCB
  459.     lds    dx,[bp+14]              ;FCB
  460. ;    lds    si,[bp+8]             ;ByteOffset
  461.     lds    si,[bp+10]             ;ByteOffset
  462.     mov    bx,[si]
  463. ;    lds    si,[bp+4]
  464.     lds    si,[bp+6]
  465.     mov    cx,[si]
  466.     mov    ah,0C0H
  467.     int    21H
  468.     mov    ah,0
  469.     pop    ds
  470.     pop    bp
  471.     ret    12
  472. PRLF_Clr endp
  473.  
  474.  
  475.  
  476.  
  477.  
  478. ;---------------------------------------------
  479. ;
  480. ; Lock Record Set  C2H
  481. ;
  482. ; var
  483. ;    ErrCode, Flags, TimeOut : Integer;
  484. ;
  485. ; ErrCode := PRLS_Lck(Flags,TimeOut);
  486. ;
  487.  
  488.  
  489. PRLS_Lck proc    far
  490.     push    bp
  491.     mov    bp,sp
  492.     push    ds
  493. ;    lds    si,[bp+8]               ;AL = Lock flag bits
  494.     lds    si,[bp+10]               ;AL = Lock flag bits
  495.     mov    ax,[si]
  496. ;    lds    si,[bp+4]               ;TimeOut Value
  497.     lds    si,[bp+6]               ;TimeOut Value
  498.     mov    bp,[si]
  499.     mov    ah,0C2h
  500.     int    21h
  501.     mov    ah,0
  502.     pop    ds
  503.     pop    bp
  504.     ret    10
  505. PRLS_Lck endp
  506.  
  507.  
  508.  
  509.  
  510.  
  511. ;----------------------------------------------
  512. ;
  513. ; Release Record Set  C3H
  514. ;
  515. ; var
  516. ;    ErrCode : Integer;
  517. ;
  518. ; ErrCode := PRLS_Rel;
  519. ;
  520.  
  521.  
  522. PRLS_Rel proc    far
  523.     mov    ah,0C3h
  524.     int    21h
  525.     mov    ah,0
  526.     ret
  527. PRLS_Rel endp
  528.  
  529.  
  530.  
  531.  
  532.  
  533. ;----------------------------------------------
  534. ;
  535. ; Clear Record Set  C4H
  536. ;
  537. ; var
  538. ;    ErrCode : Integer;
  539. ;
  540. ; errcode := PRLS_Clr;
  541. ;
  542.  
  543.  
  544. PRLS_Clr proc    far
  545.     mov    ah,0C4h
  546.     int    21h
  547.     mov    ah,0
  548.     ret
  549. PRLS_Clr endp
  550.  
  551.  
  552.  
  553.  
  554.  
  555. ;--------------------------------
  556. ; Semaphores func(197) (C5H) subfunction 00h
  557. ;
  558. ; var
  559. ;    RetCode,SemaValu,HiHandle,LoHandle,OpenCnt : Integer;
  560. ;    Sema4 : String[n];
  561. ;
  562. ; RetCode := OpenSem(Sema4,SemaValu,HiHandle,LoHandle,OpenCnt);
  563. ;
  564.  
  565.  
  566. OpenSem proc    far
  567.     push    bp
  568.     mov    bp,sp
  569.     push    ds
  570. ;    lds    dx,[bp+20]      ;ptr to Semaphore string
  571.     lds    dx,[bp+22]      ;ptr to Semaphore string
  572. ;    lds    si,[bp+16]      ;set semaphore value
  573.     lds    si,[bp+18]      ;set semaphore value
  574.     mov    cx,[si]
  575.     mov    ax,0C500h        ;set the function
  576.     int    21h
  577.     mov    bh,00h
  578. ;    lds    di,[bp+4]      ;return the open count
  579.     lds    di,[bp+6]      ;return the open count
  580.     mov    [di],bx
  581. ;    lds    di,[bp+8]      ;return low handle
  582.     lds    di,[bp+10]      ;return low handle
  583.     mov    [di],cx
  584. ;    lds    di,[bp+12]      ;return high handle
  585.     lds    di,[bp+14]      ;return high handle
  586.     mov    [di],dx
  587.     mov    ah,00h
  588.     pop    ds
  589.     pop    bp
  590.     ret    22
  591. OpenSem endp
  592.  
  593.  
  594.  
  595.  
  596.  
  597. ;--------------------------------
  598. ; Semaphores func(197) (C5H) subfunction 01h
  599. ;
  600. ; var
  601. ;    RetCode,HiHandle,LoHandle,SemaValu,OpenCnt : Integer;
  602. ;
  603. ; RetCode := ExamSem(HiHandle,LoHandle,SemaValu,OpenCnt);
  604. ;
  605.  
  606.  
  607. ExamSem proc    far
  608.     push    bp
  609.     mov    bp,sp
  610.     push    ds
  611. ;    lds    si,[bp+16]        ;hi handle
  612.     lds    si,[bp+18]        ;hi handle
  613.     mov    dx,[si]
  614. ;    lds    si,[bp+12]        ;lo handle
  615.     lds    si,[bp+14]        ;lo handle
  616.     mov    cx,[si]
  617.     mov    ax,0C501h        ;set function
  618.     int    21h
  619. ;    lds    di,[bp+8]               ;return semaphore value
  620.     lds    di,[bp+10]               ;return semaphore value
  621.     mov    [di],cx
  622.     mov    dh,00h
  623. ;    lds    di,[bp+4]
  624.     lds    di,[bp+6]
  625.     mov    [di],dx              ;return open count
  626.     mov    ah,00h
  627.     pop    ds
  628.     pop    bp
  629.     ret    16
  630. ExamSem endp
  631.  
  632.  
  633.  
  634.  
  635.  
  636. ;--------------------------------
  637. ; Semaphores func(197) (C5H) subfunction 02h
  638. ;
  639. ; var
  640. ;    RetCode,HiHandle,LoHandle,TimeOut : Integer;
  641. ;
  642. ; RetCode := WaitSem(HiHandle,LoHandle,TimeOut);
  643. ;
  644.  
  645.  
  646. WaitSem proc    far
  647.     push    bp
  648.     mov    bp,sp
  649.     push    ds
  650. ;    lds    si,[bp+12]        ;hi handle
  651.     lds    si,[bp+14]        ;hi handle
  652.     mov    dx,[si]
  653. ;    lds    si,[bp+8]               ;lo handle
  654.     lds    si,[bp+10]               ;lo handle
  655.     mov    cx,[si]
  656. ;    lds    si,[bp+4]
  657.     lds    si,[bp+6]
  658.     mov    bp,[si]              ;set time out
  659.     mov    ax,0C502h        ;set function
  660.     int     21h
  661.     mov    ah,00h
  662.     pop    ds
  663.     pop    bp
  664.     ret    12
  665. WaitSem endp
  666.  
  667.  
  668.  
  669.  
  670.  
  671. ;--------------------------------
  672. ; Semaphores func(197) (C5H) subfunction 03h
  673. ;
  674. ; var
  675. ;    RetCode,HiHandle,LoHandle : Integer;
  676. ;
  677. ; RetCode := SigSem(HiHandle,LoHandle);
  678. ;
  679.  
  680.  
  681. SigSem    proc    far
  682.     push    bp
  683.     mov    bp,sp
  684.     push    ds
  685. ;    lds    si,[bp+8]               ;hi handle
  686.     lds    si,[bp+10]               ;hi handle
  687.     mov    dx,[si]
  688. ;    lds    si,[bp+4]               ;lo handle
  689.     lds    si,[bp+6]               ;lo handle
  690.     mov    cx,[si]
  691.     mov    ax,0C503h        ;set function
  692.     int    21h
  693.     mov    ah,00h
  694.     pop    ds
  695.     pop    bp
  696.     ret    8
  697. SigSem    endp
  698.  
  699.  
  700.  
  701.  
  702.  
  703. ;--------------------------------
  704. ; Semaphores func(197) (C5H) subfunction 04h
  705. ;
  706. ; var
  707. ;    RetCode,HiHandle,LoHandle : Integer;
  708. ;
  709. ; RetCode := ClosSem(HiHandle,LoHandle);
  710. ;
  711.  
  712.  
  713. ClosSem proc    far
  714.     push    bp
  715.     mov    bp,sp
  716.     push    ds
  717. ;    lds    si,[bp+8]               ;hi handle
  718.     lds    si,[bp+10]               ;hi handle
  719.     mov    dx,[si]
  720. ;    lds    si,[bp+4]               ;lo handle
  721.     lds    si,[bp+6]               ;lo handle
  722.     mov    cx,[si]
  723.     mov    ax,0C504h        ;set function
  724.     int    21h
  725.     mov    ah,00h
  726.     pop    ds
  727.     pop    bp
  728.     ret    8
  729. ClosSem endp
  730.  
  731.  
  732.  
  733.  
  734.  
  735. ;--------------------------------
  736. ; Get or Set Lock Mode func(198) (C6H)
  737. ;
  738. ; var
  739. ;    Mode,Func : Integer;
  740. ;
  741. ; Mode := setlck(Func);
  742. ;
  743.  
  744.  
  745. setlck    proc    far
  746.     push    bp
  747.     mov    bp,sp
  748.     push    ds
  749. ;    lds    si,[bp+4]
  750.     lds    si,[bp+6]
  751.     mov    ax,[si]               ;set the subfunction
  752.     mov    ah,0C6h         ;set  the function
  753.     int    21h
  754.     mov    ah,0
  755.     pop    ds
  756.     pop    bp
  757.     ret    4
  758. setlck endp
  759.  
  760.  
  761.  
  762.  
  763.  
  764. ;--------------------------------
  765. ; Transactional Backout func(199) (C7H)
  766. ;
  767. ; var
  768. ;    RetCode, Func : Integer;
  769. ;
  770. ; RetCode := BakOuts(Func);
  771. ;
  772.  
  773.  
  774. BakOuts proc    far
  775.     push    bp
  776.     mov    bp,sp
  777.     push    ds
  778. ;    lds    si,[bp+4]               ;set the subfunction
  779.     lds    si,[bp+6]               ;set the subfunction
  780.     mov    ax,[si]
  781.     mov    ah,0C7h         ;set  the function
  782.     int    21h
  783.     mov    ah,0
  784.     pop    ds
  785.     pop    bp
  786.     ret    4
  787. BakOuts endp
  788.  
  789.  
  790.  
  791.  
  792.  
  793. ;--------------------------------
  794. ; Begin transaction  func(200) (C8H)
  795. ;
  796. ; var
  797. ;    RetCode,Mode : Integer;
  798. ;
  799. ; RetCode := btrans(Mode);
  800. ;
  801.  
  802.  
  803. btrans    proc    far
  804.     mov    ah,0C8h
  805.     call    arg1t
  806.     ret    4
  807. btrans    endp
  808.  
  809.  
  810.  
  811.  
  812.  
  813. ;--------------------------------
  814. ; End Transaction func(201) (C9H)
  815. ;
  816. ; var
  817. ;    RetCode : Integer;
  818. ;
  819. ; RetCode := etrans;
  820. ;
  821.  
  822.  
  823. etrans    proc    far
  824.     mov    ah,0C9H
  825.     int    021h
  826.     mov    ah,00h
  827.     ret
  828. etrans    endp
  829.  
  830.  
  831.  
  832.  
  833.  
  834. ;--------------------------------
  835. ; Exc.log File (202) (CA)
  836. ;
  837. ; var
  838. ;    RetCode, FcbAddr : Integer;
  839. ;
  840. ; RetCode := exclog(FcbAddr);
  841. ;
  842.  
  843. exclog    proc    far
  844.     mov    ah,0CAH
  845.     call    arg1f
  846.     ret    4
  847. exclog    endp
  848.  
  849.  
  850.  
  851.  
  852.  
  853. ;--------------------------------
  854. ; Exc Lock Set    func(203) (CBH)
  855. ;
  856. ; var
  857. ;    RetCode, Mode : Integer;
  858. ;
  859. ; RetCode := exclcks(Mode);
  860. ;
  861.  
  862.  
  863. exclcks proc    far
  864.     mov    ah,0CBH
  865.     call    arg1
  866.     ret    4
  867. exclcks endp
  868.     
  869.  
  870.  
  871.  
  872. ;--------------------------------
  873. ; Exclusive file unlock (204) (CC)
  874. ;
  875. ; var
  876. ;    RetCode, FcbAddr : Integer;
  877. ;
  878. ; RetCode := exculkf(FcbAddr);
  879. ;
  880.  
  881.  
  882. exculkf proc    far
  883.     mov    ah,0CCH
  884.     call    arg1f
  885.     ret    4
  886. exculkf endp
  887.  
  888.  
  889.  
  890.  
  891.  
  892. ;--------------------------------
  893. ; Exclusive Unlock Set (205)(CD)
  894. ;
  895. ; var
  896. ;    RetCode : Integer;
  897. ;
  898. ; RetCode := exculks;
  899. ;
  900.  
  901.  
  902. exculks proc    far
  903.     mov    ah,0CDH
  904.     int    21h
  905.     mov    ah,00h
  906.     ret
  907. exculks endp
  908.  
  909.  
  910.  
  911.     
  912.  
  913. ;--------------------------------
  914. ; Exc Clear file func(206) (CEH)
  915. ;
  916. ; var
  917. ;    RetCode, FcbAddr : Integer;
  918. ;
  919. ; RetCode := excclrf(FcbAddr);
  920. ;
  921.  
  922.  
  923. excclrf proc    far
  924.     mov    ah,0CEH
  925.     call    arg1f
  926.     ret    4
  927. excclrf endp
  928.  
  929.  
  930.  
  931.  
  932.  
  933. ;--------------------------------
  934. ; Exc Clear Set  func(207) (CFH)
  935. ;
  936. ; var
  937. ;    RetCode : Integer;
  938. ;
  939. ; RetCode := excclrs;
  940. ;
  941.  
  942.  
  943. excclrs proc    far
  944.     mov    ah,0CFH
  945.     int    21h
  946.     mov    ah,00h
  947.     ret
  948. excclrs endp
  949.  
  950.  
  951.  
  952.  
  953.  
  954. ;--------------------------------
  955. ; Log Record(s) func(208) (D0H)
  956. ;
  957. ; var
  958. ;    RetCode, Flag, Timeout : Integer ;
  959. ;    RecStr    : String[n];
  960. ;
  961. ; RetCode := reclog(RecStr,Flag,Timeout);
  962. ;
  963.  
  964.  
  965. reclog    proc    far
  966.      push     bp
  967.      mov     bp,sp
  968.      push     ds
  969. ;     lds     si,[bp+8]          ;load flags
  970.      lds     si,[bp+10]          ;load flags
  971.      mov     ax,[si]
  972. ;     lds     si,[bp+4]          ;get timeout
  973.      lds     si,[bp+6]          ;get timeout
  974.      mov     si,[si]
  975. ;     lds     dx,[bp+12]         ;get ptr to string
  976.      lds     dx,[bp+14]         ;get ptr to string
  977.      mov     bp,si              ;move timeout to BP
  978.      mov     ah,0D0h
  979.      int     21h
  980.      mov     ah,0
  981.      pop     ds
  982.      pop     bp
  983.      ret     14
  984. reclog    endp
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991. ;--------------------------------
  992. ; Record Lock func(209) (D1H)
  993. ;
  994. ; var
  995. ;    RetCode, Mode : Integer;
  996. ;
  997. ; RetCode := reclck(Mode);
  998. ;
  999.  
  1000.  
  1001. reclck    proc    far
  1002.      push     bp
  1003.      mov     bp,sp
  1004.      push     ds
  1005. ;     lds     si,[bp+4]
  1006.      lds     si,[bp+6]
  1007.      mov     bp,[si]
  1008.      mov     ah,0D1h
  1009.      int     21h
  1010.      mov     ah,0
  1011.      pop     ds
  1012.      pop     bp
  1013.      ret     6
  1014. reclck    endp
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020. ;--------------------------------
  1021. ; Record Unlock func(210) (D2H)
  1022. ;
  1023. ; var
  1024. ;    RetCode   : Integer;
  1025. ;    Semaphore : String[n];
  1026. ;
  1027. ; RetCode := reculk(Semaphore);
  1028. ;
  1029.  
  1030.  
  1031. reculk    proc    far
  1032.     mov    ah,0D2H
  1033.     call    arg1a
  1034.     ret    4
  1035. reculk    endp
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041. ;--------------------------------
  1042. ; Unlock Record Set func(211) (D3H)
  1043. ;
  1044. ; var
  1045. ;    RetCode : Integer;
  1046. ;
  1047. ; RetCode := reculks;
  1048. ;
  1049.  
  1050.  
  1051. reculks proc    far
  1052.     mov    ah,0D3H
  1053.     int    21h
  1054.     mov    ah,00h
  1055.     ret
  1056. reculks endp
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062. ;--------------------------------
  1063. ; Record Clear func(212) (D4H)
  1064. ;
  1065. ; var
  1066. ;    RetCode   : Integer;
  1067. ;    Semaphore : String[n];
  1068. ;
  1069. ; RetCode := recclr(Semaphore);
  1070. ;
  1071.  
  1072.  
  1073. recclr    proc    far
  1074.     mov    ah,0D4H
  1075.     call    arg1a
  1076.     ret    4
  1077. recclr    endp
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083. ;--------------------------------
  1084. ; Clear record set func(213) (D5H)
  1085. ;
  1086. ; var
  1087. ;    RetCode : Integer;
  1088. ;
  1089. ; RetCode := recclrs;
  1090. ;
  1091.  
  1092.  
  1093. recclrs proc    far
  1094.     mov    ah,0D5H
  1095.     int    21h
  1096.     mov    ah,00h
  1097.     ret    4
  1098. recclrs endp
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104. ;--------------------------------
  1105. ; End of Job  func(214) (D6H)
  1106. ;
  1107. ; var
  1108. ;    RetCode : Integer;
  1109. ;
  1110. ; RetCode := eoj;
  1111. ;
  1112.  
  1113. eoj    proc    far
  1114.     mov    ah,0D6H
  1115.     int    21h
  1116.     mov    ah,00h
  1117.     ret    4
  1118. eoj    endp
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124. ;--------------------------------
  1125. ; Logout System  func(215) (D7H)
  1126. ;
  1127. ; var
  1128. ;    RetCode : Integer;
  1129. ;
  1130. ; RetCode := sysout;
  1131. ;
  1132.  
  1133.  
  1134. sysout    proc    far
  1135.     mov    ah,0D7H
  1136.     int    21h
  1137.     mov    ah,00h
  1138.     ret    4
  1139. sysout    endp
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145. ;--------------------------------
  1146. ; Vol Statistics func(218) (DAH)
  1147. ;
  1148. ; var
  1149. ;    RetCode,volume : Integer;
  1150. ;    reply  : String[n];
  1151. ;
  1152. ; RetCode := volstat(volume, reply);
  1153.  
  1154.  
  1155. volstat proc    far
  1156.     mov    ah,0DAh
  1157.     push    bp
  1158.     mov    bp,sp
  1159.     push    ds
  1160.     push    es
  1161. ;    lds    si,[bp+8]     ;addr for the volume number
  1162.     lds    si,[bp+10]     ;addr for the volume number
  1163.     mov    dx,[si]       ;get the volume number
  1164. ;    les    di,[bp+4]     ;ptr to reply buffer
  1165.     les    di,[bp+6]     ;ptr to reply buffer
  1166.     inc    di          ;add 1 to get the address of the string
  1167.     int    21h
  1168.     mov    ah,00h
  1169.     pop    es
  1170.     pop    ds
  1171.     pop    bp
  1172.     ret    8
  1173. volstat endp
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179. ;--------------------------------
  1180. ; Local Disks  func(219) (DBH)
  1181. ;
  1182. ; var
  1183. ;    NumDisks : Integer;
  1184. ;
  1185. ; NumDisks := locdrv;
  1186. ;
  1187.  
  1188.  
  1189. locdrv    proc    far
  1190.     mov    ah,0DBH
  1191.     int    21h
  1192.     mov    ah,00h
  1193.     ret
  1194. locdrv endp
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200. ;--------------------------------
  1201. ; WorkStation ID func(220) (DCH)
  1202. ;
  1203. ; note: This routine returns the station number as an integer.
  1204. ;    It can also be returned in ASCII with this call.
  1205. ;
  1206. ; var
  1207. ;    StationNum : Integer;
  1208. ;
  1209. ; StationNum := wsid;
  1210. ;
  1211.  
  1212.  
  1213. wsid   proc    far
  1214.        mov     ah,0DCH
  1215.        int     21h
  1216.        mov     ah,00h
  1217.        ret
  1218. wsid   endp
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224. ;--------------------------------
  1225. ; Set Error mode func(221) (DDH)
  1226. ;
  1227. ; var
  1228. ;    mode : Integer;
  1229. ;
  1230. ; errmode(mode);
  1231. ;
  1232.  
  1233.  
  1234. errmode proc    far
  1235.     mov    ah,0DDH
  1236.     call    arg1
  1237.     ret    4
  1238. errmode endp
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244. ;--------------------------------
  1245. ; Broadcast Mode func(222) (DEH)
  1246. ;
  1247. ; var
  1248. ;    mode : Integer;
  1249. ;
  1250. ; bcsmode(mode);
  1251. ;
  1252.  
  1253. bcsmode proc    far
  1254.     mov    ah,0DEH
  1255.     call    arg1
  1256.     ret    4
  1257. bcsmode endp
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263. ;--------------------------------
  1264. ; Modify LST Device  func(223) (DFH)
  1265. ;
  1266. ; var
  1267. ;    RetCode, Mode : Integer;
  1268. ;
  1269. ; RetCode := ctlspl(Mode);
  1270. ;
  1271.  
  1272. ctlspl    proc    far
  1273.     mov    ah,0DFh
  1274.     call    arg1
  1275.     ret    4
  1276. ctlspl    endp
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282. ;--------------------------------
  1283. ; Spool Request func(224) (E0H)
  1284. ;
  1285. ; var
  1286. ;    ErrCode         : Integer;
  1287. ;    RequestBlock, Reply : String[n];
  1288. ;
  1289. ; ErrCode := splreq(RequestBlock, Reply);
  1290. ;
  1291.  
  1292. splreq    proc    far
  1293.     mov    ah,0E0h
  1294.     call    req_rep
  1295.     ret    8
  1296. splreq    endp
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302. ;--------------------------------
  1303. ; Pipe Request func(225) (E1H)
  1304. ;
  1305. ; var
  1306. ;    ErrCode         : Integer;
  1307. ;    RequestBlock, Reply : String[n];
  1308. ;
  1309. ; ErrCode := pipreq(RequestBlock, Reply);
  1310. ;
  1311.  
  1312. pipreq    proc    far
  1313.     mov    ah,0E1h
  1314.     call    req_rep
  1315.     ret    8
  1316. pipreq    endp
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322. ;--------------------------------
  1323. ; Directory Path func(226) (E2H)
  1324. ;
  1325. ; var
  1326. ;    ErrCode         : Integer;
  1327. ;    RequestBlock, Reply : String[n];
  1328. ;
  1329. ; ErrCode := dpath(RequestBlock, Reply);
  1330. ;
  1331.  
  1332. dpath    proc    far
  1333.     mov    ah,0E2h
  1334.     call    req_rep
  1335.     ret    8
  1336. dpath    endp
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342. ;--------------------------------
  1343. ; Login system func(227) (E3H)
  1344. ;
  1345. ; var
  1346. ;    ErrCode         : Integer;
  1347. ;    RequestBlock, Reply : String[n];
  1348. ;
  1349. ; ErrCode := syslog(RequestBlock, Reply);
  1350. ;
  1351.  
  1352. syslog    proc    far
  1353.     mov    ah,0E3h
  1354.     call    req_rep
  1355.     ret    8
  1356. syslog    endp
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362. ;--------------------------------
  1363. ; Set File Attribute func(228) (E4H)
  1364. ;
  1365. ; var
  1366. ;    RetCode, FcbAddr, Attribute : Integer;
  1367. ;
  1368. ; RetCode := fattr(FcbAddr, Attribute);
  1369. ;
  1370.  
  1371. fattr    proc    far
  1372.     push    bp
  1373.     mov    bp,sp
  1374.     push    ds
  1375. ;    lds    si,[bp+4]
  1376.     lds    si,[bp+6]
  1377.     mov    cx,[si]  ;cx=attribute
  1378. ;    lds    dx,[bp+8];dx=address of fcb
  1379.     lds    dx,[bp+10];dx=address of fcb
  1380.     mov    ah,0E4h
  1381.     int    21h
  1382.     mov    ah,0
  1383.     pop    ds
  1384.     pop    bp
  1385.     ret
  1386. fattr    endp
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392. ;--------------------------------
  1393. ; Update file size func(229) (E5H)
  1394. ;
  1395. ; var
  1396. ;    ErrCode,FcbAddr : Integer;
  1397. ;
  1398. ; ErrCode := updfcb(FcbAddr);
  1399. ;
  1400.  
  1401. updfcb    proc    far
  1402.     mov    ah,0E5H
  1403.     call    arg1f
  1404.     ret    4
  1405. updfcb    endp
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411. ;--------------------------------
  1412. ; Copy File to File func(230) (E6H)
  1413. ;
  1414. ; var
  1415. ;    RetCode,FcbSource,FcbDest : Integer;
  1416. ;    CountLow, CountHigh      : Integer;
  1417. ;
  1418. ; RetCode := cpyfile(FcbSource, FcbDest, CountLow, CountHigh)
  1419. ;
  1420. ;
  1421.  
  1422. cpyfile proc    far            
  1423.     mov    ah,0E6h
  1424.     push    bp
  1425.     mov    bp,sp
  1426.     push    ds
  1427.     push    es
  1428. ;    lds    si,[bp+4]           ;addr of the high byte cnt
  1429.     lds    si,[bp+6]           ;addr of the high byte cnt
  1430.     mov    dx,[si]             ;dx=high word of byte cnt
  1431. ;    lds    si,[bp+8]           ;addr low word of byte cnt
  1432.     lds    si,[bp+10]           ;addr low word of byte cnt
  1433.     mov    cx,[si]             ;cx=low 16 bits of count
  1434. ;    les    di,[bp+12]          ;address of dest fcb
  1435.     les    di,[bp+14]          ;address of dest fcb
  1436. ;    lds    si,[bp+16]          ;address of the source fcb
  1437.     lds    si,[bp+18]          ;address of the source fcb
  1438.     int    21h
  1439.     mov    ah,0
  1440.     pop    es
  1441.     pop    ds
  1442.     pop    bp
  1443.     ret    16
  1444. cpyfile endp
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450. ;--------------------------------
  1451. ; get time / date string func(231) (E7H)
  1452. ;
  1453. ; var
  1454. ;    time : String[n];
  1455. ;
  1456. ; nettod(time);
  1457. ;
  1458. ; where time is a string of the form Y M D H M S
  1459. ;
  1460.  
  1461. nettod    proc    far
  1462.     mov    ah,0E7h
  1463.     call    arg1a
  1464.     ret    4
  1465. nettod    endp
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471. ;--------------------------------
  1472. ; Set Close mode func(232) (E8H)
  1473. ;
  1474. ; var
  1475. ;    mode : Integer;
  1476. ;
  1477. ; clsmode(mode);
  1478. ;
  1479.  
  1480. clsmode proc    far
  1481.     mov    ah,0E8H
  1482.     call    arg1wor
  1483.     ret    4
  1484. clsmode endp
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491. ;--------------------------------
  1492. ; Shell Base Status func(233) (E9H)
  1493. ;
  1494. ; var
  1495. ;    RetFlags, drive : Integer;
  1496. ;
  1497. ; RetFlags := drvmap(drive);
  1498. ;
  1499.  
  1500. drvmap    proc    far
  1501.     mov    ax,0E900h
  1502.     call    arg1
  1503.     ret    4
  1504. drvmap    endp
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511. ;--------------------------------
  1512. ; Return Shell Version func(234) (EAH)
  1513. ;
  1514. ; var
  1515. ;    RetCode, Mode : Integer;
  1516. ;    EnvirStr      : String[n];
  1517. ;
  1518. ; RetCode := retshl(EnvirStr, Mode);
  1519. ;
  1520.  
  1521. retshl    proc    far
  1522.     push    bp
  1523.     mov    bp,sp
  1524.     push    ds
  1525.     push    es
  1526. ;    les    di,[bp+8]     ;set es:di to point at the buffer
  1527.     les    di,[bp+10]     ;set es:di to point at the buffer
  1528.     inc    di          ;point di at the start of the data area
  1529. ;    lds    si,[bp+4]     ;put the mode into al
  1530.     lds    si,[bp+6]     ;put the mode into al
  1531.     mov    ax,[si]
  1532.     mov    ah,0EAh
  1533.     int    21h
  1534.     mov    ah,00h
  1535.      pop     es
  1536.      pop     ds
  1537.      pop     bp
  1538.     ret    8
  1539. retshl    endp
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545. ;--------------------------------
  1546. ; ascii log File (235) (EB)
  1547. ;
  1548. ; var
  1549. ;    RetCode, Flags, TimeOut : Integer;
  1550. ;    Asciiz            : String[n];
  1551. ;
  1552. ; RetCode := asclog(Flags, TimeOut, Asciiz);
  1553. ;
  1554.  
  1555. asclog    proc    far
  1556.     push    bp
  1557.     mov    bp,sp
  1558.     push    ds
  1559. ;    lds    si,[bp+12]
  1560.     lds    si,[bp+14]
  1561.     mov    ax,[si]           ;flags into al
  1562. ;    lds    dx,[bp+4]         ;pointer to the asciiz string
  1563.     lds    dx,[bp+6]         ;pointer to the asciiz string
  1564. ;    lds    si,[bp+8]
  1565.     lds    si,[bp+10]
  1566.     mov    bp,[si]           ;time out into bp
  1567.     mov    ah,0EBH
  1568.     int    21h
  1569.     mov    ah,00h
  1570.      pop     ds
  1571.      pop     bp
  1572.     ret    12
  1573. asclog    endp
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579. ;--------------------------------
  1580. ; ASCIIZ file unlock (236) (EC)
  1581. ;
  1582. ; var
  1583. ;    RetCode : Integer;
  1584. ;    Asciiz    : String[n];
  1585. ;
  1586. ; RetCode := asculkf(Asciiz);
  1587. ;
  1588.  
  1589. asculkf proc    far
  1590.     mov    ah,0ECH
  1591.     call    arg1a
  1592.     ret    4
  1593. asculkf endp
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599. ;--------------------------------
  1600. ; ASCIIZ Clear file func(237) (EDH)
  1601. ;
  1602. ; var
  1603. ;    RetCode : Integer;
  1604. ;    Asciiz    : String[n];
  1605. ;
  1606. ; RetCode := ascclrf(Asciiz);
  1607. ;
  1608.  
  1609. ascclrf proc    far
  1610.     mov    ah,0EDH
  1611.     call    arg1a
  1612.     ret    4
  1613. ascclrf endp
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619. ;--------------------------------------------
  1620. ;
  1621. ; Get Physical Station Number  EEH
  1622. ;
  1623. ; var
  1624. ;    StationNo : Integer;
  1625. ;
  1626. ; StationNo := Get_PSN;
  1627. ;
  1628.  
  1629. Get_PSN proc    far
  1630.  
  1631.     mov    ah,0EEh
  1632.     int    21h
  1633.     mov    ah,0
  1634.     ret
  1635. Get_PSN endp
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641. ;-----------------------------------------------------
  1642. ;
  1643. ; Get Shell Table Addresses (239) EFH
  1644. ;
  1645. ; var
  1646. ;    Mode,Segment,Offset : Integer;
  1647. ;
  1648. ; Get_STA(Mode,Segment,Offset);
  1649. ;
  1650.  
  1651. Get_STA proc    far
  1652.     push    bp
  1653.     mov    bp,sp
  1654.     push    es
  1655.     push    ds
  1656. ;    mov    si,[bp+12]        ;get the mode
  1657.     mov    si,[bp+14]        ;get the mode
  1658.     mov    ax,[si]
  1659.     mov    ah,0EFh         ;set the function
  1660.     int    21h
  1661. ;    lds    di,[bp+8]        ;store the segment location
  1662.     lds    di,[bp+10]        ;store the segment location
  1663.     mov    [di],es
  1664. ;    lds    di,[bp+4]        ;store the offset location
  1665.     lds    di,[bp+6]        ;store the offset location
  1666.     mov    [di],si
  1667.     pop    ds
  1668.     pop    es
  1669.     pop    bp
  1670.     ret    12
  1671. Get_STA endp
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677. ;-----------------------------------------------
  1678. ;
  1679. ; Set Preferred File Server (240) F0H
  1680. ;
  1681. ; var
  1682. ;    RetServer, Mode, NewServ : Integer;
  1683. ;
  1684. ; RetServer := SetServ(Mode,NewServ);
  1685. ;
  1686.  
  1687. SetServ proc    far
  1688.     push    bp
  1689.     mov    bp,sp
  1690.     push    ds
  1691. ;    mov    si,[bp+8]        ;get the mode
  1692.     mov    si,[bp+10]        ;get the mode
  1693.     mov    ax,[si]
  1694. ;    mov    di,[bp+4]        ;set the preferred server number
  1695.     mov    di,[bp+6]        ;set the preferred server number
  1696.     mov    dx,[di]
  1697.     mov    ah,0F0h         ;set the function
  1698.     int    21h
  1699.     mov    ah,0
  1700.     pop    ds
  1701.     pop    bp
  1702.     ret    6
  1703. SetServ endp
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709. ;-----------------------------------------------------------
  1710. ;
  1711. ; Attach/Detach To File Server (241) F1H
  1712. ;
  1713. ; var
  1714. ;    RetCode, Mode, NewServ : Integer;
  1715. ;
  1716. ; RetCode := ModServ(Mode,NewServ);
  1717. ;
  1718.  
  1719. ModServ proc    far
  1720.     push    bp
  1721.     mov    bp,sp
  1722.     push    ds
  1723. ;    lds    si,[bp+8]        ;get the mode
  1724.     lds    si,[bp+10]        ;get the mode
  1725.     mov    ax,[si]
  1726. ;    lds    di,[bp+4]        ;set the preferred server number
  1727.     lds    di,[bp+6]        ;set the preferred server number
  1728.     mov    dx,[di]
  1729.     mov    ah,0F1h         ;set the function
  1730.     int    21h
  1731.     mov    ah,0
  1732.     pop    ds
  1733.     pop    bp
  1734.     ret    6
  1735. ModServ endp
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741. ;-------------------------------
  1742. ; Place a single integer argument into dx
  1743. ; with a return code
  1744.  
  1745. arg1    proc    near
  1746.     push    bp
  1747.     mov    bp,sp
  1748.     push    ds
  1749. ;    lds    si,[bp+6]
  1750.     lds    si,[bp+8]
  1751.     mov    dx,[si]    ;dx gets the argument
  1752.     int    21h
  1753.     mov    ah,0       ;clear ah for al return code
  1754.     pop    ds
  1755.     pop    bp
  1756.     ret
  1757. arg1    endp
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763. ;--------------------------------
  1764. ; Place a single integer argument into bp
  1765. ; for use with time outs - with a return code
  1766.  
  1767. arg1t    proc    near
  1768.     push    bp
  1769.     mov    bp,sp
  1770.     push    ds
  1771. ;    lds    si,[bp+6]
  1772.     lds    si,[bp+8]
  1773.     mov    bp,[si]    ;dx gets the argument
  1774.     int    21h
  1775.     mov    ah,0       ;clear ah for al return code
  1776.     pop    ds
  1777.     pop    bp
  1778.     ret
  1779. arg1t    endp
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. ;--------------------------------
  1787. ; Process an fcb address in a
  1788. ; function call with a return code
  1789.  
  1790. arg1f    proc    near
  1791.     push    bp
  1792.     mov    bp,sp
  1793.     push    ds
  1794. ;    lds    dx,[bp+6]      ;dx gets the argument
  1795.     lds    dx,[bp+8]      ;dx gets the argument
  1796.     int    21h
  1797.     mov    ah,0           ;clear ah for al return code
  1798.     pop    ds
  1799.     pop    bp
  1800.     ret
  1801. arg1f    endp
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807. ;--------------------------------
  1808. ; Process a single string argument in a
  1809. ; function call with a return code
  1810.  
  1811. arg1a    proc    near
  1812.     push    bp
  1813.     mov    bp,sp
  1814.     push    ds
  1815. ;    lds    dx,[bp+6]     ;ptr to parameter string
  1816.     lds    dx,[bp+8]     ;ptr to parameter string
  1817.     int    21h
  1818.     mov    ah,0          ;clear ah for al return code
  1819.     pop    ds
  1820.     pop    bp
  1821.     ret
  1822. arg1a    endp
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829. ;----------------------------
  1830. ; Perform a single integer argument
  1831. ; but without a return code
  1832.  
  1833. arg1wor proc    near
  1834.     push    bp
  1835.     mov    bp,sp
  1836.     push    ds
  1837. ;    lds    si,[bp+6]
  1838.     lds    si,[bp+8]
  1839.     mov    dx,[si]       ;dx gets the arg (or ptr)
  1840.     int    21h
  1841.     pop    ds
  1842.     pop    bp
  1843.     ret
  1844. arg1wor endp
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851. ;----------------------------
  1852. ; Perform a single string argument
  1853. ; but without a return code
  1854.  
  1855. arg1awor proc    near
  1856.     push    bp
  1857.     mov    bp,sp
  1858.     push    ds
  1859. ;    lds    dx,[bp+6]
  1860.     lds    dx,[bp+8]
  1861.     inc    dx          ;add 1 to get the start of the string
  1862.     int    21h
  1863.     pop    ds
  1864.     pop    bp
  1865.     ret
  1866. arg1awor endp
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873. ;----------------------------
  1874. ; Handle a request$ and reply$ function
  1875. ; with error code
  1876.  
  1877. req_rep proc    near
  1878.     push    bp
  1879.     mov    bp,sp
  1880.     push    ds
  1881.     push    es
  1882. ;    lds    si,[bp+10]       ;ptr to req. string
  1883.     lds    si,[bp+12]       ;ptr to req. string
  1884.     inc    si            ;add 1 to get the address of the string
  1885. ;    les    di,[bp+6]       ;ptr to var desc block for reply buf
  1886.     les    di,[bp+8]       ;ptr to var desc block for reply buf
  1887.     inc    di            ;add 1 to get the address of the string
  1888.     pushf                  ;save the direction flag
  1889.     int    21h
  1890.     popf
  1891.     mov    ah,0
  1892.     pop    es
  1893.     pop    ds
  1894.     pop    bp
  1895.     ret
  1896. req_rep endp
  1897.  
  1898.  
  1899.  
  1900. cseg    ends
  1901.     end
  1902.